package com.atguigu.cloud.controller;

import com.atguigu.cloud.apis.PayFeignApi;
import com.atguigu.cloud.entities.PayDTO;
import com.atguigu.cloud.response.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("feign")
public class OrderController {

    @Resource
    PayFeignApi payFeignApi;

    @GetMapping("pay/get/{id}")
    public Result payGet(@PathVariable("id") int id) {
        Result result = payFeignApi.get(id);
        return result;
    }

    @PostMapping("pay/add")
    public Result payAdd(@RequestBody PayDTO payDTO) {
        return payFeignApi.add(payDTO);
    }

    @GetMapping("test")
    public String test() {
        return payFeignApi.test();
    }
}
